package com.th.therp.utils;

import java.util.Random;

/**
 * 验证码生成工具类
 */
public class CodeUtils {
    private final static int codeLength = 6;

    public static String getCode(){
        Random random = new Random();
        int a;
        String result = "";
        for (int i = 0; i < codeLength; i++) {
            a = Math.abs(random.nextInt()%9);
            result += String.valueOf(a);
        }
        return result;
    }
}